﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VFTray
{
	abstract class DrawHelper
	{
		internal static void DrawCenterCross(Graphics g, float alpha, RectangleF rectImg, Pen pen)
		{
			float xc = (rectImg.Left + rectImg.Right) * 0.5F;
			float yc = (rectImg.Top + rectImg.Bottom) * 0.5F;
			g.DrawLine(pen, rectImg.Left, yc, rectImg.Right, yc);
			g.DrawLine(pen, xc, rectImg.Top, xc, rectImg.Bottom);
		}
		internal static void DrawImageRect(Graphics g, float alpha, RectangleF rectImg, Pen pen)
		{
			float xc = rectImg.Left;
			float yc = rectImg.Top;
			g.DrawRectangle(pen, xc, yc, rectImg.Width, rectImg.Height);
		}

		internal static void DrawROI(Graphics g, float alpha, RectangleF rectImg,RectangleF roi, Color color,Font font=null)
		{
			float xc = rectImg.Left + roi.X * alpha;
			float yc = rectImg.Top + roi.Y*alpha;
			g.DrawRectangle(new Pen(color), xc, yc, roi.Width * alpha, roi.Height * alpha);
			if(font!=null)
				g.DrawString("ROI", font, new SolidBrush(color), xc, yc);
		}
	}
}
